﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Hangjing.Common;
using Hangjing.Model;
using Hangjing.SQLServerDAL;
using Hangjing.Weixin;
using System.Text.RegularExpressions;

namespace Html5
{
    public partial class shopindex : shopPageBase
    {


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
              

                //判断是否有通知，并且没有阅读过
                PointsInfo user = UserHelp.GetUser_Togo();

                DeliverGroupInfo model = new DeliverGroup().GetShopNotice(user.Unid);
                if (WebUtility.NoHTML(model.hovepic).Length > 0) //有通知
                {
                    if (new noticereadlog().GetCount("mtype=2 and userid=" + user.Unid) == 0)//未阅读
                    {
                        hfhavenoice.Value = "1";
                    }
                }

                if (user.outnitice.Trim().Length > 0 || user.outnitice.Trim() != "0")
                {
                    elebox.Style["display"] = "";
                }

                meituanbindlogInfo bindlog = new meituanbindlog().GetList(1, 1, "ePoiId='" + user.Unid + "' and mtype=1", "mid", 1).FirstOrDefault();
                if (bindlog != null)
                {
                    mtbox.Style["display"] = "";
                }

                user = new Points().GetModel(user.Unid);

                UserHelp.SetLogin_Togo(user);
                mymoney.InnerText = user.money.ToString();

                AlertScript.RegStartScript(this.Page, "var  initData = {money: " + user.money + "};");

            }
        }

    }
}
